package com.jzr.medical.controller.api;

import com.jzr.common.entity.vo.Result;
import com.jzr.medical.db1.dto.ShiftPlanDto;
import com.jzr.medical.db1.service.ShiftPlanService;
import com.jzr.medical.db1.vo.ShiftPlanVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/shiftPlan")
public class ShiftPlanController {
    @Autowired
    private ShiftPlanService shiftPlanService;

    @PostMapping("/list")
    public Result<List<ShiftPlanVo>> list(@RequestBody ShiftPlanDto dto){
        List<ShiftPlanVo> list = shiftPlanService.list(dto);
        return Result.success("成功",list);
    }

    @PostMapping("/saveBatch")
    public Result<List<ShiftPlanVo>> saveBatch(@RequestBody List<ShiftPlanVo> list){
        List<ShiftPlanVo>  result = shiftPlanService.saveBatch(list);
        return Result.success("成功",result);
    }
}
